home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2007 November
/
PCWorld_2007-11_cd.bin
/
v cisle
/
softatlas
/
SDA16.exe
/
{app}
/
rssfeed.xslt
< prev
next >
Wrap
Extensible Markup Language
|
2007-02-03
|
16KB
|
450 lines
<?xml version="1.0" encoding="utf-8"?>
<!--Copyright SOFTATLAS LTD 2006. Using without SoftAtlas permision is strongly prohibited.-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:nsAtom="http://www.w3.org/2005/Atom"
xmlns:nsAtom03="http://purl.org/atom/ns#"
xmlns:syn="http://purl.org/rss/1.0/modules/syndication/"
xmlns:nsrss="http://purl.org/rss/1.0/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
xmlns:fn="http://www.w3.org/2005/xpath-functions"
xmlns:user="urn:user"
xmlns:var="urn:var"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
exclude-result-prefixes="user xs fn user" >
<xsl:template match="/">
<html>
<head>
<meta>
<xsl:attribute name="content">text/html; charset=utf-8</xsl:attribute>
<xsl:attribute name="http-equiv">content-type</xsl:attribute>
</meta>
<link href="main.css" rel="stylesheet" type="text/css" />
<title>RSS Feed</title>
</head>
<xsl:element name="body">
<xsl:attribute name="class">cTitlesBody</xsl:attribute>
<xsl:apply-templates select="rss"></xsl:apply-templates>
<xsl:apply-templates select="rdf:RDF"></xsl:apply-templates>
<xsl:apply-templates select="nsAtom:feed"></xsl:apply-templates>
<xsl:apply-templates select="nsAtom03:feed"></xsl:apply-templates>
</xsl:element>
</html>
</xsl:template>
<xsl:template match="nsAtom03:feed">
<div>
<xsl:attribute name="class">cChannel</xsl:attribute>
<h1>
<xsl:attribute name="class">cChannelTitle</xsl:attribute>
<xsl:value-of select="nsAtom03:title" />
</h1>
<xsl:apply-templates select="nsAtom03:link" />
<div>
<xsl:attribute name="class">cChannelSubtitle</xsl:attribute>
<xsl:value-of select="nsAtom03:subtitle" />
</div>
<div>
<xsl:attribute name="class">cChannelDate</xsl:attribute>
<xsl:value-of select="nsAtom03:updated" />
</div>
<xsl:apply-templates select="nsAtom03:entry" />
<div>
<xsl:attribute name="class">cChannelRights</xsl:attribute>
<xsl:value-of select="nsAtom03:rights" />
</div>
</div>
</xsl:template>
<xsl:template match="nsAtom03:entry">
<div>
<xsl:attribute name="class">cItem</xsl:attribute>
<xsl:element name="a">
<xsl:attribute name="name">
<xsl:value-of select="concat('rssitem',position())"/>
</xsl:attribute>
</xsl:element>
<h2>
<xsl:attribute name="class">cItemTitle</xsl:attribute>
<xsl:value-of select="nsAtom03:title" />
</h2>
<xsl:for-each select="nsAtom03:link">
<a>
<xsl:attribute name="class">cItemLink</xsl:attribute>
<xsl:attribute name="href">
<xsl:value-of select="@href" />
</xsl:attribute>
<xsl:attribute name="title">
<xsl:value-of select="@href" />
</xsl:attribute>
<!--<xsl:value-of select="@href" />-->
Link to article.
</a>
</xsl:for-each>
<div>
<xsl:attribute name="class">cItemDescription</xsl:attribute>
<xsl:value-of select="nsAtom03:content" disable-output-escaping="yes" />
</div>
<div>
<xsl:attribute name="class">cItemDescription</xsl:attribute>
<xsl:value-of select="nsAtom03:summary" disable-output-escaping="yes" />
</div>
<xsl:apply-templates select="nsAtom03:author" />
<xsl:apply-templates select="nsAtom03:category" />
</div>
</xsl:template>
<xsl:template match="nsAtom03:category">
<div>
<xsl:attribute name="class">cItemCategory</xsl:attribute>
<a>
<xsl:attribute name="href">
<xsl:value-of select="@scheme" />
</xsl:attribute>
<xsl:attribute name="title">
<xsl:value-of select="@scheme" />
</xsl:attribute>
<xsl:value-of select="@label" />
</a>
</div>
</xsl:template>
<xsl:template match="nsAtom03:author">
<div>
<xsl:attribute name="class" >cItemAuthor</xsl:attribute>
<a>
<xsl:attribute name="class">cItemAuthorEmail</xsl:attribute>
<xsl:attribute name="href">
<xsl:value-of select="nsAtom03:email" />
</xsl:attribute>
<xsl:attribute name="title">
<xsl:value-of select="nsAtom03:email" />
</xsl:attribute>
<xsl:value-of select="nsAtom03:email" />
</a>
</div>
</xsl:template>
<xsl:template match="nsAtom03:link">
<a>
<xsl:attribute name="class">cChannelLink</xsl:attribute>
<xsl:attribute name="href">
<xsl:value-of select="@href" />
</xsl:attribute>
<xsl:attribute name="title">
<xsl:value-of select="@href" />
</xsl:attribute>
<xsl:if test="'self'=@rel">
Link to channel.
</xsl:if>
<xsl:if test="'self'!=@rel">
Link to channel home.
</xsl:if>
<!-- <xsl:value-of select="@href" />-->
</a>
</xsl:template>
<xsl:template match="nsAtom:feed">
<div>
<xsl:attribute name="class">cChannel</xsl:attribute>
<h1>
<xsl:attribute name="class">cChannelTitle</xsl:attribute>
<xsl:value-of select="nsAtom:title" />
</h1>
<xsl:apply-templates select="nsAtom:link" />
<div>
<xsl:attribute name="class">cChannelSubtitle</xsl:attribute>
<xsl:value-of select="nsAtom:subtitle" />
</div>
<div>
<xsl:attribute name="class">cChannelDate</xsl:attribute>
<xsl:value-of select="nsAtom:updated" />
</div>
<xsl:apply-templates select="nsAtom:entry" />
<div>
<xsl:attribute name="class">cChannelRights</xsl:attribute>
<xsl:value-of select="nsAtom:rights" />
</div>
</div>
</xsl:template>
<xsl:template match="nsAtom:entry">
<div>
<xsl:attribute name="class">cItem</xsl:attribute>
<xsl:element name="a">
<xsl:attribute name="name">
<xsl:value-of select="concat('rssitem',position())"/>
</xsl:attribute>
</xsl:element>
<h2>
<xsl:attribute name="class">cItemTitle</xsl:attribute>
<xsl:value-of select="nsAtom:title" />
</h2>
<xsl:for-each select="nsAtom:link">
<a>
<xsl:attribute name="class">cItemLink</xsl:attribute>
<xsl:attribute name="href">
<xsl:value-of select="@href" />
</xsl:attribute>
<xsl:attribute name="title">
<xsl:value-of select="@href" />
</xsl:attribute>
<!--<xsl:value-of select="@href" />-->
Link to article.
</a>
</xsl:for-each>
<div>
<xsl:attribute name="class">cItemDescription</xsl:attribute>
<xsl:value-of select="nsAtom:content" disable-output-escaping="yes" />
</div>
<div>
<xsl:attribute name="class">cItemDescription</xsl:attribute>
<xsl:value-of select="nsAtom:summary" disable-output-escaping="yes" />
</div>
<xsl:apply-templates select="nsAtom:author" />
<xsl:apply-templates select="nsAtom:category" />
</div>
</xsl:template>
<xsl:template match="nsAtom:category">
<div>
<xsl:attribute name="class">cItemCategory</xsl:attribute>
<a>
<xsl:attribute name="href">
<xsl:value-of select="@scheme" />
</xsl:attribute>
<xsl:attribute name="title">
<xsl:value-of select="@scheme" />
</xsl:attribute>
<xsl:value-of select="@label" />
</a>
</div>
</xsl:template>
<xsl:template match="nsAtom:author">
<div>
<xsl:attribute name="class" >cItemAuthor</xsl:attribute>
<a>
<xsl:attribute name="class">cItemAuthorEmail</xsl:attribute>
<xsl:attribute name="href">
<xsl:value-of select="nsAtom:email" />
</xsl:attribute>
<xsl:attribute name="title">
<xsl:value-of select="nsAtom:email" />
</xsl:attribute>
<xsl:value-of select="nsAtom:email" />
</a>
</div>
</xsl:template>
<xsl:template match="nsAtom:link">
<a>
<xsl:attribute name="class">cChannelLink</xsl:attribute>
<xsl:attribute name="href">
<xsl:value-of select="@href" />
</xsl:attribute>
<xsl:attribute name="title">
<xsl:value-of select="@href" />
</xsl:attribute>
<xsl:if test="'self'=@rel">
Link to channel.
</xsl:if>
<xsl:if test="'self'!=@rel">
Link to channel home.
</xsl:if>
<!-- <xsl:value-of select="@href" />-->
</a>
</xsl:template>
<xsl:template match="rdf:RDF">
<div>
<xsl:attribute name="class">cChannel</xsl:attribute>
<h1>
<xsl:attribute name="class">cChannelTitle</xsl:attribute>
<xsl:value-of select="nsrss:channel/nsrss:title" />
</h1>
<xsl:apply-templates select="nsrss:channel" />
<xsl:if test="nsrss:channel/nsrss:description">
<div>
<xsl:attribute name="class">cChannelDescription</xsl:attribute>
<xsl:value-of select="nsrss:channel/nsrss:description" disable-output-escaping="yes" />
</div>
</xsl:if>
<div>
<xsl:attribute name="class">cChannelDate</xsl:attribute>
<xsl:value-of select="nsrss:channel/dc:date" />
</div>
<div>
<xsl:attribute name="class">cChannelSubject</xsl:attribute>
<xsl:value-of select="nsrss:channel/dc:subject" />
</div>
<xsl:apply-templates select="nsrss:item" />
</div>
</xsl:template>
<xsl:template match="nsrss:item">
<div>
<xsl:attribute name="class">cItem</xsl:attribute>
<xsl:element name="a">
<xsl:attribute name="name">
<xsl:value-of select="concat('rssitem',position())"/>
</xsl:attribute>
</xsl:element>
<h2>
<xsl:attribute name="class">cItemTitle</xsl:attribute>
<xsl:value-of select="nsrss:title" />
</h2>
<a>
<xsl:attribute name="class">cItemLink</xsl:attribute>
<xsl:attribute name="href">
<xsl:value-of select="nsrss:link" />
</xsl:attribute>
<xsl:attribute name="title">
<xsl:value-of select="nsrss:link" />
</xsl:attribute>
<!-- <xsl:value-of select="nsrss:link" />-->
Link to article.
</a>
<div>
<xsl:attribute name="class">cItemDate</xsl:attribute>
<xsl:value-of select="nsrss:pubDate" />
</div>
<div>
<xsl:attribute name="class">cItemCreator</xsl:attribute>
<xsl:value-of select="dc:creator" disable-output-escaping="yes"/>
</div>
<div>
<xsl:attribute name="class">cItemDescription</xsl:attribute>
<xsl:value-of select="nsrss:description" disable-output-escaping="yes" />
</div>
<xsl:if test ="dc:subject">
<div>
<xsl:attribute name="class">cItemSubject</xsl:attribute>
<xsl:value-of select="dc:subject" disable-output-escaping="yes" />
</div>
</xsl:if>
<xsl:if test ="dc:description">
<div>
<xsl:attribute name="class">cItemDescription</xsl:attribute>
<xsl:value-of select="dc:description" disable-output-escaping="yes" />
</div>
</xsl:if>
</div>
</xsl:template>
<xsl:template match="nsrss:channel">
<a>
<xsl:attribute name="class">cChannelLink</xsl:attribute>
<xsl:attribute name="href">
<xsl:value-of select="nsrss:link" />
</xsl:attribute>
<xsl:attribute name="title">
<xsl:value-of select="nsrss:link" />
</xsl:attribute>
<!-- <xsl:value-of select="nsrss:link" />-->
Link to channel home.
</a>
</xsl:template>
<xsl:template match="rss">
<xsl:apply-templates select="channel" />
</xsl:template>
<xsl:template match="channel">
<div>
<xsl:attribute name="class">cChannel</xsl:attribute>
<h1>
<xsl:attribute name="class">cChannelTitle</xsl:attribute>
<xsl:value-of select="title" />
</h1>
<a>
<xsl:attribute name="class">cChannelLink</xsl:attribute>
<xsl:attribute name="href">
<xsl:value-of select="link" />
</xsl:attribute>
<xsl:attribute name="title">
<xsl:value-of select="link" />
</xsl:attribute>
<!-- <xsl:value-of select="link" />-->
Link to channel home.
</a>
<xsl:if test="itunes:author">
<div>
<xsl:attribute name="class">cChannelAuthor</xsl:attribute>
<xsl:value-of select="itunes:author" />
</div>
</xsl:if>
<xsl:if test="itunes:summary">
<div>
<xsl:attribute name="class" >cChannelSummary</xsl:attribute>
<xsl:value-of select="itunes:summary" disable-output-escaping="yes" />
</div>
</xsl:if>
<xsl:if test="description">
<div>
<xsl:attribute name="class" >cChannelDescription</xsl:attribute>
<xsl:value-of select="description" disable-output-escaping="yes" />
</div>
</xsl:if>
<xsl:apply-templates select="item" />
<div>
<xsl:attribute name="class">cChannelRights</xsl:attribute>
<xsl:value-of select="copyright" />
</div>
</div>
</xsl:template>
<xsl:template match="item">
<div>
<xsl:attribute name="class">cItem</xsl:attribute>
<xsl:element name="a">
<xsl:attribute name="name">
<xsl:value-of select="concat('rssitem',position())"/>
</xsl:attribute>
</xsl:element>
<h2>
<xsl:attribute name="class">cItemTitle</xsl:attribute>
<xsl:value-of select="title" />
</h2>
<xsl:if test="enclosure/@url">
<a>
<xsl:attribute name="class">cItemLink</xsl:attribute>
<xsl:attribute name="href">
<xsl:value-of select="enclosure/@url" />
</xsl:attribute>
<xsl:attribute name="title">
<xsl:value-of select="enclosure/@url" />
</xsl:attribute>
<!-- <xsl:value-of select="enclosure/@url" />-->
Link to download or open podcast media file.
</a>
<br/>
</xsl:if>
<a>
<xsl:attribute name="class">cItemLink</xsl:attribute>
<xsl:attribute name="href">
<xsl:value-of select="link" />
</xsl:attribute>
<xsl:attribute name="title">
<xsl:value-of select="link" />
</xsl:attribute>
<!-- <xsl:value-of select="link" />-->
Link to article.
</a>
<div>
<xsl:attribute name="class" >cItemSummary</xsl:attribute>
<xsl:value-of select="itunes:summary" disable-output-escaping="yes" />
</div>
<div>
<xsl:attribute name="class" >cItemDescription</xsl:attribute>
<xsl:value-of select="description" disable-output-escaping="yes" />
</div>
<div>
<xsl:attribute name="class">cItemDate</xsl:attribute>
<xsl:value-of select="pubDate" />
</div>
<xsl:if test="enclosure/@length">
<span>
<xsl:attribute name="class">cItemLength</xsl:attribute>
<b>Length: </b>
<xsl:value-of select="enclosure/@length" />
</span>
</xsl:if>
<xsl:if test="itunes:duration">
<span>
<xsl:attribute name="class">cItemDuration</xsl:attribute>
<b>Duration: </b>
<xsl:value-of select="itunes:duration" />
</span>
</xsl:if>
</div>
</xsl:template>
</xsl:stylesheet>